package com.nuonuo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author duan
 * @version 1.0
 * @date 2023/3/29 15:12
 */
@RestController
@RequestMapping(value = "test")
public class TestController {

//    @Value("${nuonuo.userIds}")
//    private List<String> userIds;

    @Autowired
    private Config config;

    @GetMapping(value = "getUserIds")
    public String getUserIds() {
        List<String> userIds = config.getUserIds();
        for (String userId : userIds) {
            System.out.println("userId = " + userId);
        }
        return "OK";
    }

    @RequestMapping(value = "sayHello")
    public String sayHello() {
        return "test hello";
    }

    @RequestMapping(value = "sayHi")
    public String sayHi() {
        return "test hi";
    }

    @RequestMapping(value = "sayGood")
    public String sayGood() {
        return "test good";
    }

}
